/**
 *
 */
package com.gxa.ssm251.service.impl;


import com.gxa.ssm251.exception.BusinessException;
import com.gxa.ssm251.mapper.AdminMapper;
import com.gxa.ssm251.mapper.OrderMapper;
import com.gxa.ssm251.pojo.Admin;
import com.gxa.ssm251.pojo.City;
import com.gxa.ssm251.pojo.Order;
import com.gxa.ssm251.service.AdminService;
import com.gxa.ssm251.service.OrderService;
import com.gxa.ssm251.util.MD5Util;
import org.springframework.stereotype.Controller;

import javax.annotation.Resource;
import java.util.List;

/**
 * @author bilei
 * @date 2021年3月31日
 */
@Controller("orderService")
public class OrderServiceImpl implements OrderService {


    @Resource
    private OrderMapper orderMapper = null;

    @Override
    public List<Order> selectAllOrder(String page,String size) {
        Integer p=Integer.valueOf(page);
        Integer s=Integer.valueOf(size);
        List<Order> orderList=orderMapper.selectAllBypage((p-1)*s,s);
        return orderList;
    }

    @Override
    public List<Order> selectAllOrder() {
        List<Order> orderList=orderMapper.selectAllO();
        return orderList;
    }

    @Override
    public Integer add(Order order) {
        Integer integer=orderMapper.insertOrder(order);
        return integer;
    }

    @Override
    public Integer selectCount() {
        Integer count=orderMapper.selectAll();
        return count;
    }


}
